package com.zwps.biz.api.enums;

public enum TrainEnum {
    LAW_AND_REGULATIONS(1, "法律法规培训"),
    RESPONSIBILITY_SYSTEM(2, "责任制培训"),
    MECHANISM(3, "机制培训"),
    SAFETY(4, "安全培训"),
    PROFESSIONAL_TECHNICAL(5, "专业技术培训");

    private final int code;
    private final String description;


    TrainEnum(int code, String description) {
        this.code = code;
        this.description = description;
    }

    // 获取 code
    public int getCode() {
        return code;
    }

    // 获取 description
    public String getDescription() {
        return description;
    }

    // 根据 code 获取枚举
    public static String getByCode(int code) {
        for (TrainEnum type : TrainEnum.values()) {
            if (type.getCode() == code) {
                return type.getDescription();
            }
        }
        return null;
    }

}
